# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=libmbim
pkgver=1.30.0
pkgrel=1
pkgdesc="MBIM modem protocol helper library"
url="https://www.freedesktop.org/wiki/Software/libmbim/"
arch=(loong64 x86_64)
license=(GPL2)
depends=(
  bash
  glib2
  systemd
)
makedepends=(
  bash-completion
  git
  gobject-introspection
  gtk-doc
  help2man
  meson
)
provides=(libmbim-glib.so)
_commit=8415687e4f30ae5e36f407f179c8147f1529725c  # tags/1.30.0^0
source=("git+https://gitlab.freedesktop.org/mobile-broadband/libmbim.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd libmbim
  git describe --tags | sed 's/-rc/rc/;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd libmbim
}

build() {
  local meson_options=(
    -D gtk_doc=true
  )

  arch-meson libmbim build "${meson_options[@]}"
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
